#include "HT66F002.h"
#include "Sys_init.h"

union 	Fbit	_SysFlag;	
u16 Time_100msCnt;
 void main()
 {   
	Sys_init();
    while(1)
      { 
        _clrwdt();
		
	  if(Flag_2ms)
		{ 
		  Flag_2ms=0;		  
		  MotoControl();		  
		}		
	  if(Flag_100ms)
		{
		  Flag_100ms=0;	
		  Time_100msCnt++;
		  if(Time_100msCnt>=23)
			{
			  Flag_Moto=1;
			}
		  if(Time_100msCnt>=33)
			{
			  Flag_Moto=0;
			}
		  if(Time_100msCnt>=43)
			{
			  Flag_Moto=1;
			}
		  if(Time_100msCnt>=61)
			{
			  Flag_close=1;			  
			}
		  if(Time_100msCnt>=111)
			{
			  Flag_close=0;
			  Flag_Moto=0;			  
			  Time_100msCnt=0;
			}					
		}	
		
		
	  }
 }